#pragma once

#include "../core/ApplicationContext.h"
#include <includeBase.h>

namespace QtUtil {
QLabel* createLabel(
    QWidget* parent,
    const QString& text,
    Qt::Alignment alignment = Qt::AlignRight | Qt::AlignVCenter,
    const QString& name = ""
);
QLineEdit* createLineEdit(QWidget* parent, const QString& name);
QLineEdit* createPassword(QWidget* parent, const QString& name);
QPushButton* createButton(
    QWidget* parent,
    const QString& name,
    const QString& text
);
QComboBox* createComboBox(
    QWidget* parent,
    const QString& name,
    const QStringList& items,
    const QStringList& keys
);
QCheckBox* createCheckBox(
    QWidget* parent,
    const QString& text,
    const QString& name = ""
);
QSpinBox* createSpinBox(
    QWidget* parent,
    const QString& name,
    int defaultValue = 0
);
QDoubleSpinBox* createDoubleSpinBox(
    QWidget* parent,
    const QString& name,
    double defaultValue = 0.0
);
QTableWidget* createTableWidget(
    QWidget* parent,
    const QString& name,
    const QStringList& headers,
    const vector<int>& columnWidths
);
QMenu* createMenu(QMenuBar* parent, const QString& name, const QString& title);
QToolBar* createToolBar(
    shared_ptr<ApplicationContext> context,
    const QString& name
);
void createMenuSeparator(QMenu* menu);
QVBoxLayout* createVerticalLayout(QWidget* parent, const QString& name);
QHBoxLayout* createHorizontalLayout(QWidget* parent, const QString& name);
QGridLayout* createGridLayout(const QString& name);
QTabWidget* createTabWidget(QWidget* parent, const QString& name);
QTabWidget* createTabWidget(
    QWidget* parent,
    const QString& name,
    QRect geometry
);
QWidget* createTab(
    QTabWidget* tabWidget,
    const QString& name,
    const QString& label
);
void messageBox(QWidget* parent, const QString& title, const QString& message);
QIcon* createIcon(const QString& iconFile);
void showErrorMessageBox(
    shared_ptr<ApplicationContext> context,
    std::exception& e
);
void showErrorMessageBox(
    shared_ptr<ApplicationContext> context,
    const QString& message
);
double getRandomDouble();
}; // namespace QtUtil
